home *** CD-ROM | disk | FTP | other *** search
- #!/usr/sbin/perl
- $SWIN2HOME=$ENV{'SWIN2HOME'};
- open(AUTOEXEC,"<$SWIN2HOME/tmp/autoexec.bat");
- @bat=<AUTOEXEC>;
- close AUTOEXEC;
- open(AUTOEXEC,">$SWIN2HOME/tmp/autoexec.bat");
-
- seek(AUTOEXEC,0,0);
-
- foreach (@bat) {
-
- if (/Net Use G: \$SWINHOME\/windows
- /) {next;}
- if (/Net Use H: \$HOME
- /) {next;}
- if (/Net Use F: \/CDROM
- /) {next;}
- if (/Net Use K: \/floppy
- /) {next;}
-
- if (/rem Do not Delete any of the code between this remark and the end of this
- /) {$IN_BLOCK=1;next;}
-
- if ($IN_BLOCK) {
- if (m#rem block\.
- #o) {next;}
- if (m#rem
- #o) {next;}
- if (m#net use j: \$SWINHOME
- #o) {next;}
- if (m#if exist j:\\12\d+\.\* goto out
- #o) {next;}
- if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\upquest\.sh
- #o) {next;}
- if (m#if errorlevel 2 goto warn
- #o) {next;}
- if (m#if errorlevel 1 goto upd
- #o) {next;}
- if (m#:warn
- #o) {next;}
- if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\nupwarn\.sh
- #o) {next;}
- if (m#if errorlevel 2 goto upd
- #o) {next;}
- if (m#if errorlevel 1 goto out
- #o) {next;}
- if (m#:upd
- #o) {next;}
- if (m#if exist g:\\sgupdate\.bat g:\\sgupdate\.bat
- #o) {next;}
- if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\baddist\.sh
- #o) {next;}
- if (m#goto end
- #o) {next;}
- if (m#:out
- #o) {next;}
- if (m#net use j: /D
- #o) {next;}
- if (m#:end
- #o) {next;}
- if (m#rem
- #o) {next;}
- if (m#rem End of Block
- #o) {$IN_BLOCK=0;next;}
- }
-
- print AUTOEXEC;
- }
-
- print AUTOEXEC <<ADDENDUM;
- IF EXIST G:\SWDOCK.BAT CALL G:\SWDOCK.BAT
- ADDENDUM
-